//package com.hss.spring;
//
//import com.alibaba.fastjson.JSON;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//import org.springframework.ui.ModelMap;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.io.PrintWriter;
//
//@Controller
//public class HelloController {
//    @RequestMapping(value = "/hello",method = {RequestMethod.GET,RequestMethod.POST})
//    public String printHello(ModelMap model){
//        model.addAttribute("message", "Hello Spring MVC Framework  HSS !");
//        return "/hello";
//    }
//
//    //http://localhost:8088/uid/35
//    @RequestMapping(value = "/uid/{id}",method = {RequestMethod.GET,RequestMethod.POST})
//    public String pathValueId(@PathVariable (value = "id")String id, ModelMap model){
//        model.addAttribute("message", id);
//        return "/hello";
//    }
//
//
//    //http://localhost:8088/somePath?id=19&sname=%22hss%22&t_id=234
//    @RequestMapping("/somePath")
//    public void requestResponseExample(HttpServletRequest request,
//                                       HttpServletResponse reponses, Model model) throws IOException {
//
//        // Todo something here
//
//        String id = request.getParameter("id");
//        String sname = request.getParameter("sname");
//        String t_id = request.getParameter("t_id");
//        PrintWriter out = reponses.getWriter();
//        out.println(id + "  " + sname + "  " + t_id);
//        out.flush();
//        out.close();
//    }
//
//    //http://localhost:8088/user?sid=123
//    @RequestMapping(value = "/user",method = {RequestMethod.GET,RequestMethod.POST})
//    public String userName(@RequestParam(required = true, value = "sid", defaultValue = "100") String name, ModelMap model){
//        model.addAttribute("message", name);
//
//        return "/hello";
//    }
//
//    @RequestMapping(value = "/save",method = {RequestMethod.GET,RequestMethod.POST})
//    @ResponseBody
//    public String responseSave( ModelMap model){
////        model.addAttribute("message", name);
//        User user = new User();
//        user.setName("zhang san");
//        user.setAge(54);
//
//        return JSON.toJSONString(user);
//    }
//}
